// DocView.cpp : implementation file
//

#include "stdafx.h"
#include "DocView.h"


// CDocView

IMPLEMENT_DYNAMIC(CDocView, CEdit)

CDocView::CDocView()
{

}

CDocView::~CDocView()
{
}


BEGIN_MESSAGE_MAP(CDocView, CEdit)
END_MESSAGE_MAP()


HRESULT STDMETHODCALLTYPE CDocView::CreateWnd(saf::IGenericPanel *pParent, HWND hWndParent)
{
	CWnd *wndParent = CWnd::FromHandle(hWndParent);
	CRect _Rect(0, 0, 100, 100);

	if (Create(WS_HSCROLL|WS_VSCROLL|WS_CHILD|WS_VISIBLE|ES_LEFT|ES_MULTILINE|ES_WANTRETURN,
		_Rect, wndParent, 0))
	{
		//this->GetEditCtrl().SetLimitText(100);
		::SendMessage(m_hWnd, WM_SETFONT, (WPARAM)::GetStockObject(DEFAULT_GUI_FONT), 0);

		CString strText;
		strText.LoadString(IDS_Description);
		SetWindowText(strText);

		saf::CTextResource<char*>	text;
		text.LoadResource(IDR_TEXT_INFO);

		::SetWindowTextA(m_hWnd, text.GetTextResource());

		return S_OK;
	}

	return S_FALSE;
}


HRESULT STDMETHODCALLTYPE CDocView::OnCloseDataView(saf::safCloseAction *ca)
{
	*ca = saf::safCloseActionFree;

	return S_OK;
}

// CDocView message handlers


